package com.yue.pattern.singleton;

/**
 * 饿汉模式
 * 类加载的时候， 静态初始化块执行。初始化类的实例。 线程安全， 不满足lazy loading
 * Created by qiuyang on 06/04/2017.
 */
public class BadmashSingleton {
    private static BadmashSingleton singleton;

    private BadmashSingleton(){}

    static {
        singleton = new BadmashSingleton();
    }

    public static BadmashSingleton getInstance() {
        return singleton;
    }
}
